﻿using EWC.Core.Util.Extensions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EWC.Core.WebApi.Filters
{
    public class ResponseResult<T>
    {
        public EResultCode Code { get; set; } = EResultCode.Success;

        public string Message { get; set; }

        public T Data { get; set; }

        public ResponseResult()
        {
            Message = Message ?? Code.GetDescription();
        }

    }

    public enum EResultCode
    {
        [Description("处理成功")]
        Success = 200,

        [Description("处理失败")]
        Fail = 400,

        [Description("错误")]
        Error = 500
    }
}
